package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.ManholeCurDao;
import cn.topevery.garden.entity.po.ManholeCur;
import cn.topevery.garden.entity.query.ManholeCurQuery;
import cn.topevery.garden.entity.vo.ManholeCurVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 井盖当前状态表
 *
 * @author code-generate
 * @date 2021-09-06
 */
@Service
public class ManholeCurLogic extends BaseLogic<ManholeCur> {
    @Autowired
    ManholeCurDao manholeCurDao;

    @Override
    public BaseEntityDao<ManholeCur, Integer> getDao() {
        return manholeCurDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<ManholeCurVO> listPage(ManholeCurQuery query) {
        return manholeCurDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        manholeCurDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param manholeCur 实体
     */
    public void saveOrUpdate(String userId, ManholeCur manholeCur){
        manholeCurDao.saveOrUpdate(userId,manholeCur);
    }

    public ManholeCur getByDeviceCode(String deviceCode) {
        return manholeCurDao.getByDeviceCode(deviceCode);
    }

}
